

//
//  CPJWebViewController.swift
//  Sina
//
//  Created by YYY on 2017/8/30.
//  Copyright © 2017年 成品家（北京）网路科技有限公司. All rights reserved.
//

import UIKit

class CPJWebViewController: CPJBaseViewController {

    private lazy var webView = UIWebView(frame: UIScreen.main.bounds)
    
    //网页链接 didSet方法
    var urlString: String?
    {
        didSet
        {
            guard let urlString = urlString,
                let url = URL(string: urlString) else
            {
                return
            }
            webView.loadRequest(URLRequest(url: url))
        }
    }
    
    override func setUpTableView()
    {
        view.insertSubview(webView, belowSubview: navigationView)
        webView.backgroundColor = UIColor.white
        
        navitem.title = "网页"
        
        webView.scrollView.contentInset.top = navigationView.height
    }
    
}
